package com.iplatform.file.function.meta.utils;

import java.util.List;

/**
 * @author Dair
 * @since
 */
public class ExcleCellInfo {
	
	
	private String value;
	
	private Long id;
	
	private int x1;
	
	
	private int x2;
	
	private int y1;
	
	private int y2;
	
	private Long pId;
	
	
	public Long getpId() {
		return pId;
	}
	
	public void setpId(Long pId) {
		this.pId = pId;
	}
	
	public Long getId() {
		return id;
	}
	
	public void setId(Long id) {
		this.id = id;
	}
	
	private List<ExcleCellInfo> childList;
	
	public String getValue() {
		return value;
	}
	
	public void setValue(String value) {
		this.value = value;
	}
	
	public int getX1() {
		return x1;
	}
	
	public void setX1(int x1) {
		this.x1 = x1;
	}
	
	public int getX2() {
		return x2;
	}
	
	public void setX2(int x2) {
		this.x2 = x2;
	}
	
	public int getY1() {
		return y1;
	}
	
	public void setY1(int y1) {
		this.y1 = y1;
	}
	
	public int getY2() {
		return y2;
	}
	
	public void setY2(int y2) {
		this.y2 = y2;
	}
	
	public List<ExcleCellInfo> getChildList() {
		return childList;
	}
	
	public void setChildList(List<ExcleCellInfo> childList) {
		this.childList = childList;
	}
	
	
	@Override
	public String toString() {
		return "ExcleCellInfo{" +
				"value='" + value + '\'' +
				", x1=" + x1 +
				", x2=" + x2 +
				", y1=" + y1 +
				", y2=" + y2 +
				", childList=" + childList +
				'}';
	}
	
	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (!(o instanceof ExcleCellInfo)) {
			return false;
		}
		
		ExcleCellInfo that = (ExcleCellInfo) o;
		
		if (getX1() != that.getX1()){
			return false;
		}
		if (getX2() != that.getX2()){
			return false;
		}
		if (getY1() != that.getY1()){
			return false;
		}
		if (getY2() != that.getY2()){
			return false;
		}
		return getValue() != null ? getValue().equals(that.getValue()) : that.getValue() == null;
	}
	
	@Override
	public int hashCode() {
		int result = getValue() != null ? getValue().hashCode() : 0;
		result = 31 * result + getX1();
		result = 31 * result + getX2();
		result = 31 * result + getY1();
		result = 31 * result + getY2();
		return result;
	}
}
